package com.queue.rabbitmq.listener;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


@Component
public class WorkReceiveListener {

    @RabbitListener(queues = "queue_work")
    public void receiveMessage(String msg, Channel channel, Message message){
        System.out.println("1接收到的消息：" + msg);
    }


    @RabbitListener(queues = "queue_work")
    public void receiveMessage(Object obj, Channel channel, Message message){
        System.out.println("2接收到的消息：" + obj);
    }
}
